package org.mybatis.test;

import org.mybatis.binding.MapperProxyFactory;
import org.mybatis.test.dao.IUserDao;

import java.util.HashMap;
import java.util.Map;


public class Main {
    public static void main(String[] args) {
        MapperProxyFactory<IUserDao> factory = new MapperProxyFactory<>(IUserDao.class);
        Map<String, String> sqlSession = new HashMap<>();

        sqlSession.put("org.mybatis.test.dao.IUserDao.queryUserName", "模拟 Mapper.xml中SQL语句的操作，查询用户姓名");
        sqlSession.put("org.mybatis.test.dao.IUserDao.queryUserAge", "模拟 Mapper.xml中SQL语句的操作，查询用户姓名");
        IUserDao userDao = factory.newInstance(sqlSession);

        Integer integer = userDao.queryUserAge("10001");
        System.out.println(integer);
    }
}









































